home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
CENVIW2.ZIP
/
WINSHELL.BAT
< prev
next >
Wrap
DOS Batch File
|
1993-09-12
|
1KB
|
40 lines
@echo off
:: WinShell.bat - execute windows with the specified shell, where
:: the shell is the first argument to WinShell.bat.
:: Other input parameters are passed to the shell.
:: This program is to be run from DOS and uses the
:: DOS version of CEnvi, NOT THE WINDOWS VERSION.
::
:: Example: Execute AmiPro.exe with the C:\ToDoList.sam document
:: WinShell c:\AmiPro\AmiPro.exe C:\ToDoList.sam
::
CEnvi %0.bat %1
GOTO CENVI_EXIT
#define SYSTEM_INI "C:\\WIN\\SYSTEM.INI"
main(argc,argv)
{
// the first argument is the shell; or progman if there is no first argument
ShellName = ( argc < 2 ? "progman" : argv[1] );
// read in all the lines of system.ini
fp = fopen(SYSTEM_INI,"r");
assert( fp != NULL );
for ( Count = 0; NULL != (Line[Count] = fgets(fp)); Count++ ) ;
fclose(fp);
// write out all of those lines, but substitute the shell= line
fp = fopen(SYSTEM_INI,"w");
while( NULL != Line[0] ) {
if ( !memicmp(Line[0],"shell=",6) )
sprintf(Line[0]+6,"%s\n",ShellName);
fputs(Line[0],fp);
Line++;
}
fclose(fp);
}
:CENVI_EXIT
win.com %2 %3 %4 %5 %6 %7 %8 %9